//
//  SecondViewController.m
//  UITestDemo
//
//  Created by Qianfeng on 15/8/14.
//  Copyright (c) 2015年 Qianfeng. All rights reserved.
//

#import "SecondViewController.h"
extern float size;
@interface SecondViewController ()
{
    UIView *_orangeView;
    UIView *_blueView;
}
@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initUI];
}
-(void)setSize:(float)size
{
    _size = size;
    _orangeView.frame =CGRectMake(0, 0, 80+20*self.size , 80+20*self.size);
}
-(void)initUI
{
    _orangeView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 80, 80)];
    _orangeView.backgroundColor = [UIColor orangeColor];
    _orangeView.center = self.view.center;
    _orangeView.autoresizesSubviews = YES;
    _blueView = [[UIView alloc]initWithFrame:CGRectMake(10, 10, 60, 60)];
    _blueView.backgroundColor = [UIColor blueColor];
   
    _blueView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin   |UIViewAutoresizingFlexibleTopMargin|
    UIViewAutoresizingFlexibleBottomMargin;
    
    [self.view addSubview:_orangeView];
    [_orangeView addSubview:_blueView];
    //[self.view addSubview:blueView];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
